%******************************************************************
%** This is the sampling program that generates "trialdata1.mat" **
%** Created by XXXXXXXXXXX, Dec 19, 2011                         **
%** number of trials:1000                                        **
%** w:the weight for the random part, varying from 0 to 1        **
%** n:varing from 50 to 1000 (sample size)                       **
%** output:data for simulation I                                 **       
%******************************************************************
clear; clc; format long; trial=1000; a=0; b=1; k=1;
lower=0; upper=1; trialdata1=ones(1,4*trial)*-999;
w=unifrnd(0,1,trial,1); 
n=unidrnd(950,[trial,1])+49;
mu=unifrnd(0.05,0.95,1000,1);
sigma=unifrnd(min(upper-mu,mu-lower)/5,max(upper-mu,mu-lower),trial,1);
for i=1:1:trial
    trialdata1(1:n(i),(i-1)*4+1:i*4)=stnd1(n(i),mu(i),sigma(i),w(i),a,b);
end
save trialdata1.mat 

